<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

		
<%if current_user %>
	<%	my_rank = current_user.comment_rank(comment)
		can_rank_again = current_user.can_rank_again_comment?(comment)
		if my_rank%>
			<% if my_rank == 1 %>
				<div class="votedup"></div>
			 <%elsif can_rank_again%>
				 <%= link_to_remote '', {:before => "hideRankPanel('rankingpanelcontainer#{comment.id}')", :url => {:action => "rankup", :controller => "proposal_comments", :id => comment.id, :proposal_id => @proposal.id}},
									{:id => "voteup", :class=>"voteup", :href => url_for(:action => "rankup", :controller => "proposal_comments", :id => comment.id, :proposal_id => @proposal.id)} %>
				 <%= image_tag "spinner.gif", :style => 'display: none;', :id => 'loadingup' %>
			<%end%>
				<%= render :partial => 'fragments/votes_and_rank', :locals => {:object => comment} %>
			<% if my_rank == 3 %>
				<div class="voteddown"/>
			<% elsif can_rank_again%>
				<%= link_to_remote '', {:before => "hideRankPanel('rankingpanelcontainer#{comment.id}')", :url => {:action => "rankdown", :controller => "proposal_comments", :id => comment.id, :proposal_id => @proposal.id}},
									{:id => "votedown",:class=>"votedown", :href => url_for(:action => "rankup", :controller => "proposal_comments", :id => comment.id, :proposal_id => @proposal.id)} %>
				<%= image_tag "spinner.gif", :style => 'display: none;', :id => 'loadingdown' %>					
			<%end%>		
	<%else%>
	<%= link_to_remote '', {:before => "hideRankPanel('rankingpanelcontainer#{comment.id}')", :url => {:action => "rankup", :controller => "proposal_comments", :id => comment.id, :proposal_id => @proposal.id}},
	{:id => "voteup", :class=>"voteup", :href => url_for(:action => "rankup", :controller => "proposal_comments", :id => comment.id, :proposal_id => @proposal.id)} %>
	<%= image_tag "spinner.gif", :style => 'display: none;', :id => 'loadingup' %>
	<%= render :partial => 'fragments/votes_and_rank', :locals => {:object => comment} %>
	<%= link_to_remote '', {:before => "hideRankPanel('rankingpanelcontainer#{comment.id}')", :url => {:action => "rankdown", :controller => "proposal_comments", :id => comment.id, :proposal_id => @proposal.id}},
	{:id => "votedown",:class=>"votedown", :href => url_for(:action => "rankup", :controller => "proposal_comments", :id => comment.id, :proposal_id => @proposal.id)} %>
	<%= image_tag "spinner.gif", :style => 'display: none;', :id => 'loadingdown' %>
	<%end %>
<%else%>
	<%= render :partial => 'fragments/votes_and_rank', :locals => {:object => comment} %>
<%end %>